import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hook_rent/pages/home/tab_index/index_recommend_data.dart';
import 'package:hook_rent/pages/home/tab_index/index_recommend_item_widget.dart';

class IndexRecommend extends StatelessWidget {
  final List<IndexRecommendItem> dataList;
  const IndexRecommend({super.key, this.dataList = indexRecommendData});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(10),
      decoration: const BoxDecoration(
        color: Color(0x08000000),
      ),
      child: Column(
        children: [
          const Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(
                "房源推荐",
                style: TextStyle(fontWeight: FontWeight.w600),
              ),
              Text(
                '更多',
                style: TextStyle(fontWeight: FontWeight.w600),
              ),
            ],
          ),
          10.verticalSpace,
          Wrap(
            spacing: 10.w,
            runSpacing: 10.w,
            children: dataList
                .map(
                  (item) => IndexRecommendItemWidget(
                    data: item,
                  ),
                )
                .toList(),
          )
        ],
      ),
    );
  }
}
